package com.health.manage.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;

/**
 *
 * @Description: 用药记录模型
 * @author: user
 */
@Data
@TableName("pharmacy")
public class Pharmacy implements Serializable{

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键")
	@TableId(value = "id", type = IdType.AUTO) //主键注解
	private Long id;

	@ApiModelProperty(value = "居民")
	@TableField("user_id")
	private String userId;

	@TableField(exist = false)
	private User user;

	@ApiModelProperty(value = "用药日期")
	@TableField("create_date")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private String createDate;

	@ApiModelProperty(value = "用药名称")
	@TableField("name")
	private String name;

	@ApiModelProperty(value = "服用药量")
	@TableField("info")
	private String info;

	@ApiModelProperty(value = "记录日期")
	@TableField("end_date")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private String endDate;

	@ApiModelProperty(value = "记录人")
	@TableField("create_id")
	private String createId;

	@TableField(exist = false)
	private User creator;
}
